package com.brayan.webapp.repository;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import com.brayan.webapp.model.UploadedImage;

@Stateless
public class ImageRepository {
	@PersistenceContext
	EntityManager em;
	
	/**
	 * Retrieve an Image from the dedicated image table.
	 * @param id Provide the id.
	 * @return
	 */
	public UploadedImage getImageById(Long id){
		UploadedImage uploadedImage = em.find(UploadedImage.class, id);
		return uploadedImage;
	}
}
